<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	template="/resources/layout/templateInterno.xhtml"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:t="http://myfaces.apache.org/tomahawk"
    xmlns:rich="http://richfaces.org/rich">
	<ui:define name="body">
		
		<h:form  id="igrejaPesquisa" styleClass="form">
		 <t:fieldset id="idfsDadosIgreaj" styleClass="panel" legend="Filtros">
			<a4j:region id="filtroPesquisa">
				<div class="grid-8-12">
					<h:messages style="color : red;padding-left : 8px" />
				</div>
				  <div class="grid-6-12">
					<h:outputLabel class="form-lbl"  value="Nome:"/>				
					<h:inputText styleClass="form-txt"  value="#{igrejaCadastroBean.igreja.nome}" id="nomePesquisa" />
				 </div>
				  <div class="grid-2-12">
					<h:outputLabel class="form-lbl"  value="Cód. Pesquisa:"/>				
					<h:inputText styleClass="form-txt"  value="#{igrejaCadastroBean.igreja.coSeqIgreja}" id="codPesquisa" />
				 </div>	
				   <div class="grid-2-12">
					<h:outputLabel class="form-lbl"  value="CNPJ"/>				
					<h:inputText styleClass="form-txt"  value="#{igrejaCadastroBean.igreja.cnpj}" id="cnpjPesquisa" />
				 </div>	
				 <div class="field-clear"></div>
			</a4j:region>
		</t:fieldset>
			<div style="padding-bottom: 20px; padding-top: 20px">
				 <div class="grid-2-12">
					<a4j:commandButton id="cbPesquisar"  styleClass="form-button" action="#{igrejaCadastroBean.pesquisarIgreja}" reRender="igrejaPesquisaTable" value="Pesquisar" >
					</a4j:commandButton>
				</div>
			</div>
			<div class="field-clear"></div>
			<div style="padding: 20px" >
			 	<rich:dataTable style="width: 500px;" id="igrejaPesquisaTable"  var="igreja" value="#{igrejaCadastroBean.listaIgrejas}" >
				  <f:facet  name="header">
                    <rich:columnGroup >
                            <rich:column style="text-align: left"  styleClass="ui-state-default" >
                                <strong><h:outputText value="Cód. Igreja" /></strong>
                            </rich:column>
                            <rich:column style="text-align: left"  styleClass="ui-state-default" >
                                <strong><h:outputText value="Nome" /></strong>
                            </rich:column>
                            <rich:column style="text-align: left"  styleClass="ui-state-default" >
                                <strong><h:outputText value="CNPJ" /></strong>
                            </rich:column>
                             <rich:column style="text-align: left"  styleClass="ui-state-default" >
                                <strong><h:outputText value="Telfone" /></strong>
                            </rich:column>
                    	</rich:columnGroup>
                  </f:facet>
 				<rich:columnGroup >	
 					<rich:column >
						<h:outputText value="#{igreja.coSeqIgreja}" />
					</rich:column>		
					 <rich:column>
						<h:outputText value="#{igreja.nome}" />
					</rich:column>
					<rich:column>
						<h:outputText value="#{igreja.cnpj}" />
					</rich:column>
					<rich:column>
						<h:outputText value="#{igreja.telefone}" />
					</rich:column>
				</rich:columnGroup>
			</rich:dataTable>
		</div>
		</h:form>
			<t:saveState id="membroVo" value="#{membroPesquisa.membroVo}"/> 

	</ui:define>
</ui:composition>
